<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>
    <include file="Public/sidebar"/>
        <div class="main-content">
            <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
                <include file="Public/breadcrumbs"/>
                <!-- /section:basics/content.breadcrumbs -->
                    <div class="page-content">
                        <include file="Public/set"/>

                        <!-- /section:settings.box -->
                        <div class="row">
                            <div class="col-xs-12 "  style="padding: 35px;" >
                                <div class="row">
                                    <form method="get" action="">
                                        <div class="col-xs-2 col-xs-offset-4">
                                            <input type="text" name="no" class="form-control" placeholder="料号名称">
                                        </div>
                                        <div class="col-xs-2">
                                            <input type="text" name="supplier_name" class="form-control" placeholder="供应商编码">
                                        </div>
                                        <div class="col-xs-2">
                                            <input type="text" name="desc" class="form-control" placeholder="描述">
                                        </div>
                                        <div class="col-xs-2 ">
                                            <button class="btn btn-primary btn-sm">搜索</button>
                                        </div>
                                    </form>
                                </div>
                                <table class="table">
                                    <tr >
                                        <th>物料号</th>
                                        <th>描述</th>
                                        <th>供应商编码</th>
                                        <th>安全库存</th>
                                        <th>采购价格</th>
                                        <th>售价</th>
                                        <th>操作</th>
                                    </tr>
                                    <volist name="info" id="vo">
                                        <TR class="item_{$vo['item_id']}">
                                            <td>{$vo['item_no']}</td>
                                            <td>{$vo['item_desc']}</td>
                                            <td>{$vo['supplier_name']}</td>
                                            <td>{$vo['safe_qty']}</td>
                                            <td>{$vo['go_price']}</td>
                                            <td>{$vo['unit_price']}</td>
                                            <td>
                                                <a href="{:U('Itemno/id')}?id={$vo['item_id']}" class="text-info">查看</a>
                                                |
                                                <a href="{:U('Itemno/change_item')}?id={$vo['item_id']}" class="text-primary">修改</a>
                                                |
                                                <span onClick="delit({$vo['item_id']})" class="text-danger">删除</span>

                                            </td>
                                        </TR>
                                    </volist>
                                </table>
                                <div class="row text-center">
                                    {$page}
                                </div>
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div><!-- /.page-content -->
                </div>
            </div><!-- /.main-content -->
        <include file="Public/footer"/>

        </div><!-- /.main-container -->

        <include file="Public/footerjs"/>
    <!-- inline scripts related to this page -->
    </body>
    <script type="text/javascript">
        function delit(id) {
            var m=confirm("是否删除该物料号");
            if(m){
                $.ajax({
                    url:'{:U('Itemno/delete_item')}?id='+id,
                    success:function(data){
                        if(data.status){
                            confirm("删除成功！");
                            $(".item_"+id).remove();

                        }else{
                            confirm("删除失败！");
                        }
                    }
                })
            }
        }
    </script>
</html>